\(\int \csc ^2(c+d x) (a+b \sin ^2(c+d x)) \, dx\) [71]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 21, antiderivative size = 16 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=b x-\frac {a \cot (c+d x)}{d} \]

[Out]

b*x-a*cot(d*x+c)/d

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3091, 8} \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=b x-\frac {a \cot (c+d x)}{d} \]

[In]

Int[Csc[c + d*x]^2*(a + b*Sin[c + d*x]^2),x]

[Out]

b*x - (a*Cot[c + d*x])/d

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 3091

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[A*Cos[e +
 f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1))), x] + Dist[(A*(m + 2) + C*(m + 1))/(b^2*(m + 1)), Int[(b*Sin[e
+ f*x])^(m + 2), x], x] /; FreeQ[{b, e, f, A, C}, x] && LtQ[m, -1]

Rubi steps \begin{align*} \text {integral}& = -\frac {a \cot (c+d x)}{d}+b \int 1 \, dx \\ & = b x-\frac {a \cot (c+d x)}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=b x-\frac {a \cot (c+d x)}{d} \]

[In]

Integrate[Csc[c + d*x]^2*(a + b*Sin[c + d*x]^2),x]

[Out]

b*x - (a*Cot[c + d*x])/d

Maple [A] (verified)

Time = 0.88 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.38

method result size
derivativedivides \(\frac {-a \cot \left (d x +c \right )+b \left (d x +c \right )}{d}\) \(22\)
default \(\frac {-a \cot \left (d x +c \right )+b \left (d x +c \right )}{d}\) \(22\)
risch \(b x -\frac {2 i a}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}\) \(25\)
parallelrisch \(\frac {2 b x d +a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\cot \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{2 d}\) \(35\)
norman \(\frac {b x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+b x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {a}{2 d}-\frac {a \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+\frac {a \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}+2 b x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right ) \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}\) \(127\)

[In]

int(csc(d*x+c)^2*(a+b*sin(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(-a*cot(d*x+c)+b*(d*x+c))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 32, normalized size of antiderivative = 2.00 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=\frac {b d x \sin \left (d x + c\right ) - a \cos \left (d x + c\right )}{d \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)^2*(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

(b*d*x*sin(d*x + c) - a*cos(d*x + c))/(d*sin(d*x + c))

Sympy [F]

\[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=\int \left (a + b \sin ^{2}{\left (c + d x \right )}\right ) \csc ^{2}{\left (c + d x \right )}\, dx \]

[In]

integrate(csc(d*x+c)**2*(a+b*sin(d*x+c)**2),x)

[Out]

Integral((a + b*sin(c + d*x)**2)*csc(c + d*x)**2, x)

Maxima [A] (verification not implemented)

none

Time = 0.40 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.44 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=\frac {{\left (d x + c\right )} b - \frac {a}{\tan \left (d x + c\right )}}{d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

((d*x + c)*b - a/tan(d*x + c))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 39 vs. \(2 (16) = 32\).

Time = 0.41 (sec) , antiderivative size = 39, normalized size of antiderivative = 2.44 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=\frac {2 \, {\left (d x + c\right )} b + a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - \frac {a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{2 \, d} \]

[In]

integrate(csc(d*x+c)^2*(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(2*(d*x + c)*b + a*tan(1/2*d*x + 1/2*c) - a/tan(1/2*d*x + 1/2*c))/d

Mupad [B] (verification not implemented)

Time = 13.62 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00 \[ \int \csc ^2(c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx=b\,x-\frac {a\,\mathrm {cot}\left (c+d\,x\right )}{d} \]

[In]

int((a + b*sin(c + d*x)^2)/sin(c + d*x)^2,x)

[Out]

b*x - (a*cot(c + d*x))/d